package com.xianyl.libsforandroid.model;

import java.io.Serializable;


/**
 * 人的对象类,所有用户\帐号基本类
 * @author xianyl
 * @date 2015-3-1 下午7:22:10
 */
public class People implements Serializable{
	/**可序列化标识**/
	private static final long serialVersionUID = 1L;
	private String id;
	private String name;

	
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	
	
	@Override
	public String toString() {
		//显示格式为  name (email)
		return new StringBuffer(this.name)
					.append(" (").append(this.id).append(")")
					.toString();
	}
	
	@Override
	public boolean equals(Object o) {
		//只判断用户名是否一致
		try {
			return this.getName().equals(((People) o).getName());	
		} catch (Exception e) {
			return false;
		}
	}
	
	
	
}
